package com.example.questionnairespringboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.questionnairespringboot.Req.PersonReq;
import com.example.questionnairespringboot.entity.Tenant;
import com.example.questionnairespringboot.mapper.TenantMapper;
import com.example.questionnairespringboot.service.ITenantService;
import org.springframework.stereotype.Service;


@Service
public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> implements ITenantService {

    public boolean login(PersonReq personReq) {
        QueryWrapper<Tenant> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("account", personReq.getAccount());
        queryWrapper.eq("password", personReq.getPassword());
        Tenant one =getOne(queryWrapper);
        return one != null;
    }


}
